package com.outsider.module;

import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Fail;
import org.nutz.mvc.annotation.Ok;

import com.outsider.entity.Student;
@IocBean
@At("/user")
@Ok("json")
@Fail("http:500")
public class StudentModule {

    @Inject
    private Dao dao;

    @At
    public int count() {
    	if (dao==null) return -6;
        return dao.count(Student.class);
    }

}
